/**
 * Created by Administrator on 2016/11/19.
 */

package com.webonn.frame.util

import javax.ws.rs.Produces
import javax.ws.rs.WebApplicationException
import javax.ws.rs.core.MediaType

@Produces(MediaType.APPLICATION_JSON + "; charset=UTF-8", MediaType.TEXT_HTML + "; charset=UTF-8")
class EntityError(message: String, status: Int) : WebApplicationException(message, status) {
    constructor(message: String) : this(message, 400) {
    }

    /*constructor(e: Throwable) : this("Internal Server Error, message is '${e.message}'", 500) {
    }*/

    constructor(e: Throwable) : this("内部错误", 500) {
    }

    public val code = response.status
}
